#include <iostream>
#include <string>
#include "thi_sinh.h"
#include "mylib.h"

using namespace std;

unsigned sl_thi_sinh_main = 0; // so luong thi sinh

Ds_Ts head, tail;

int main() {
	cout << fixed << setprecision(1);
	//-------------------------------
	ofstream create_file;
	create_file.open ( "TS_SapXep.out", ios::out);
	create_file.close();
	create_file.open ( "TS_Do.out", ios::out );
	create_file.close();
	create_file.open ( "TS_CLC.out", ios::out);
	create_file.close();
	//-------------------------------
	head = new thi_sinh;
	char status[2];
	int choice;
	while ( true ) {
		cout << endl << "--------------------------------" << endl;
		menu();
		cin >> choice;
		switch ( choice ) {
		case 1:
			input_from_file( head );
			break;
		case 2:
			do {
				input ( head );
				cout << "Nhap tiep (c/k)?";
				fflush(stdin);
				cin.getline( status, 2);
				sl_thi_sinh_main ++;
			} while ( status[0] == 'c' && sl_thi_sinh_main <= 10000 );
			break;

		case 3:
			cout << "Danh sach thi sinh do:" << endl;
			print_do( head);
			break;

		case 4:
			cout << "Nhap ma thi sinh can phuc khao:";
			{
				string maTS;
				fflush(stdin);
				getline (cin, maTS);
				phuc_khao ( maTS, head );
			}
			break;

		case 5:
			cout << "Nhap diem Tieng Anh" << endl;
			bo_xung_TA ( head);
			break;

		case 6:
			input_ngoai_ngu (head);
			break;

		case 7:
			cout << "Danh sach lop CLC:" << endl;
			print_CLC( head );
			break;

		case 0:
			system ("pause");
			return 0;
		}
	}
	system ("pause");
	return 0;

}
